package com.lrr.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lrr.dao.AccountantDao;
import com.lrr.entity.Accountant;
import com.lrr.entity.AccountantType;
import com.lrr.entity.QueryVo;
import com.lrr.service.AccountantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AccountantServiceImpl implements AccountantService {

    @Autowired
    AccountantDao dao;

    @Override
    public PageInfo<Accountant> list(QueryVo vo, Integer pageNum) {
        PageHelper.startPage(pageNum,10);
        List<Accountant> list = dao.list(vo);
        return new PageInfo<Accountant>(list);
    }

    @Override
    public List<AccountantType> selectTypes() {
        return dao.selectTypes();
    }

    @Override
    public void add(Accountant accountant) {
        dao.add(accountant);
    }

    @Override
    public int delAll(String ids) {
        return dao.delAll(ids);
    }
}
